<!--#INCLUDE FILE="conn.asp"-->
<!-- #include file="aFunction_charCode.asp" -->
<!-- #include file="ad_comSub.asp" -->
<!-- #include file="ad_function.asp" -->

<%
Call tslt_useridentity12_error_end()

If session("tslt_useridentity")=1 Or session("tslt_useridentity")=2 Then
    Call setupC()
End If 
%>

<html>
<head>
<title></title>
<link href=../style/<%=session("tslt_stylefolder")%>/admin.css rel="stylesheet" type="text/css">
</HEAD>
<body bgcolor=#aaaac4>
<center>
<br>
<table><tr><td class="font2"></td></tr></table>
<br>
<table width="85%" border="0" bgcolor="#f7f6f6" cellspacing="0" cellpadding="0">
       <tr> 
               <td align="left" valign="middle">
                      <img src="../images/tushan2.gif" align="middle" width=100 height=50>
                      <font size=2><b>&nbsp;>>&nbsp;<a style="cursor:hand;text-decoration:underline" onclick="showtable(1)"></a><b></font>
              </td>
        </tr>
</table>

<script Language=JavaScript>
      function showtable(sid)
      {
            whichEl = eval("showtable" + sid);
            if (whichEl.style.display == "none")
            {
                 eval("showtable" + sid + ".style.display=\"\";");
            }
            else
            {
                 eval("showtable" + sid + ".style.display=\"none\";");
            }
      }
</Script>

<table id="showtable1" style="DISPLAY: none" width="600" border="0" bgcolor="#f7f6f6" cellspacing="3" cellpadding="3">
      <form method=POST name=addcommunity action=community_manage.asp?MYadd=yes>
            <tr align=center>
                <td>
                        д<input type="text" name="CommunityName">
                        <input type="submit" name="submitbtn" value="ȷ">  
                        <input type="reset" name="resetbtn" value="">  
                        <input type="button" value="  " onclick="showtable(1)"> 
                </td>
            </tr>
      </form>
</table>

<br> 
<%
if Request.QueryString("MYadd")="yes" then
        call add_CommunityName()
end if
%>
<table width="85%" border="1" bgcolor="#f7f6f6" cellspacing="0" cellpadding="0" bordercolordark="#CCCCCC" bordercolorlight="#000000">
           <tr align=center>
                 <td width="25%"><b></b></td>
                 <td width="250"><b>Ͻ</b></td>
                 <td width="45"><b></b></td>
                 <td width="45"><b></b></td>
                 <td><b></b></td>
           </tr>
<%
           dim rs
           dim sql
           sql="select * from community order by CommunitySort ASC"
           set rs=conn.execute(sql)
                 if rs.eof then
                        response.write "<SCRIPT language=Javascript>passwords(promptInfo_community_manage(0))</SCRIPT>"
                 else
                       do while not rs.eof
                            response.write "<tr align=center>"
                            response.write "<td>" & rs("CommunityName") & "</td>"                  
                            response.write "<td>"
                                  call SelectBoardName(rs("id"))
                            response.write "</td>"
                            response.write "<td>" & rs("CommunitySort") & "</td>"
%>
                            <td width="45"><input type="button" value="޸" name="modibtn" onClick="location.href='community_modify.asp?communityid=<%=rs("id")%>';"> <input type="button" value="ɾ" name="delbtn" onClick="if(confirm('ҪɾɾͬʱɾȫԼеȫӼ¼ز'))location='community_delete.asp?communityid=<%=rs("id")%>';"></td>
<%
                            response.write "<td>"
                            if rs("CommunityHidden")=true then response.write "<SCRIPT language=Javascript>passwords(promptInfo_community_manage(1))</SCRIPT>" else response.write "&nbsp;" 
                            response.write "</td>"
                            response.write "</tr>"
                            rs.movenext
                      loop
                 end if
            rs.close
            set rs=nothing
%>
 </table>
</center>
</body>
</html>

<%
Call conn_Nothing()

sub SelectBoardName(aaa)
        response.write"<select size=1 width=10 name=HiddenSelect>"
              dim rs
              set rs=conn.execute("select boardname,boardid from board where Communityid="&aaa&" order by boardsort ASC") 
                    do while not rs.eof
                          response.write"<option value='"&rs("boardid")&"'>"&rs("boardname")&"</option>"
                          rs.movenext 
                    loop
              rs.close
              set rs=nothing
        response.write"</select>"
end sub

sub add_CommunityName()
        dim CommunityName2
        CommunityName2=Request.form("CommunityName")
        if CommunityName2<>"" then
              dim rs,sql
              sql="select * from community where CommunityName = '"&CommunityName2&"'"     
              set rs=server.createobject("adodb.recordset")
              rs.Open sql, Conn, 1, 3  
                     if rs.bof or rs.eof then
                            rs.addnew
                            rs("CommunityName") = CommunityName2
                            rs.update
                     else
                            Response.write"<SCRIPT language=Javascript>passwords(promptInfo_community_manage(2))</SCRIPT>"
                            Response.End
                     end if
              rs.close
              set rs=nothing 
              Response.write"<SCRIPT language=Javascript>passwords(promptInfo_community_manage(3))</SCRIPT>"
       end if
end sub

%>

